/*
 * HittedState.cpp
 *
 *  Created on: 17/01/2011
 *      Author: Nenem
 */

#include "HittedState.h"



void HittedState::Enter(int delta, int time, GameObject *obj, Scenery *scenery, Graphics *graphics){
	this->time = 0;
	cout << obj->getObjID() << ": "<< "Enter Hitted State\n";

}

void HittedState::Execute(int delta, int time, GameObject *obj, Scenery *scenery, Graphics *graphics){
	Hitted *hitted = obj->model->battle->getHitted();
	this->time+= delta;
	//Take Damage todo

	if(this->time * hitted->getRecoverySpeed() > 1000){
		obj->stateMachine->ChangeState(delta, time, obj->stateIdle, scenery, graphics);
		obj->model->battle->getHitted()->setIsHitted(false);
	}
	cout << obj->getObjID() << ": "<< "Execute Hitted State\n";
}

void HittedState::Exit(int delta, int time, GameObject *obj, Scenery *scenery, Graphics *graphics){
	cout << obj->getObjID() << ": "<< "Leave Hitted State\n";
}
